import * as Tool from './tool'

const mutations = {
  add(state, m) {
    state.count += m
  },
  reduce(state, n) {
    console.log('n:', n)
    state.count -= n
  },
  setCurrentUser(state, val) {
    state.currentUser = val
    Tool.saveCurrentUser(val)
  },
  setAccessToken(state, val) {
    state.accessToken = val
    Tool.saveAccessToken(val)
  },
  setLastLoginTime(state, val) {
    state.lastLoginTime = val
    Tool.saveLastLoginTime(val)
  },
  setApplicationData(state, val) {
    state.applicationData = val
    Tool.saveApplicationData(val)
  },
  setNavigateData(state, val) {
    state.navigateData = val
    Tool.saveNavigateData(val)
  },
  setCurrentVoteColumn(state, val) {
    state.currentVoteColumn = val
    Tool.saveCurrentVoteColumn(val)
  }
}

export default mutations
